/******************************************************************************
/
/  Authors:
/           Ilan Bar-Magen    061220380  silanm@t2 
/    		Shalev Mintz      066078189  shalevmi@t2  
/
/  Submition date: 6/8/2008
/
/  
/
/
******************************************************************************/

#include "library2.h" 
//#include "defenitions.h"
#include "europope.h" 


void* init(int n, int defaultSalary)
	{ if (n <= 0) return NULL;
	  EuroPope * DS = new EuroPope(n,defaultSalary); return (void*)DS; } 


StatusType attack(void* DS, int town1, int town2)
	{	if (DS == NULL) return FAILURE;
		else return ((EuroPope *)DS)->attack(town1,town2); }

StatusType getTown(void* DS, int id, int* townId) 
	{	if (DS == NULL) return FAILURE;
		else return ((EuroPope *)DS)->getTown(id, townId); }

StatusType getPopeTax(void* DS, int town, int* tax) 
	{	if (DS == NULL) return FAILURE;
		else return ((EuroPope *)DS)->getPopeTax(town, tax); }

StatusType changePopeTax(void* DS, int townFrom, int townTo, int additionalTax) 
	{	if (DS == NULL) return FAILURE;
		else return ((EuroPope *)DS)->changePopeTax(townFrom,townTo, additionalTax); }

StatusType changeSalary(void* DS, int town, int newSalary) 
	{	if (DS == NULL) return FAILURE;
		else return ((EuroPope *)DS)->changeSalary(town, newSalary); }

void quit(void* DS)
{if (DS != NULL) delete ((EuroPope *)DS); 
return;}

